<?php

/**
 * SocialEngine
 *
 * @category   Application_Extensions
 * @package    Sitepage
 * @copyright  Copyright 2010-2011 BigStep Technologies Pvt. Ltd.
 * @license    http://www.socialengineaddons.com/license/
 * @version    $Id: ActivityFeed.php 2011-05-05 9:40:21Z SocialEngineAddOns $
 * @author     SocialEngineAddOns
 */
class Sitepage_Form_Admin_Settings_ActivityFeed extends Engine_Form {
	
	public function init() {
		$this->setAttribs ( array ('id' => 'activity_feed_form' ) )->setTitle ( 'Activity Feed Settings' )->setDescription ( 'Below you have been given the options to customize the Activity Feeds related to Pages. These customizations in Activity Feeds need some mandatory changes to be done in the activity feed file which are specified below. (With every setting below, we have provided as the first option that you can replace the Core "Activity Feed" widget with the SocialEngineAddOns "Activity Feed" widget and then you will not have to modify the core activity files. If that option is not chosen by you, you would need to either automatically or manually modify the files by choosing one of the other 2 options.) Once you configure all the settings below, click on "Save Changes" to save them.' );
		
		$this->addElement ( 'Radio', 'sitepage_feed_type', array ('label' => 'Directory Items / Pages Activity Feed Type', 'description' => "Select the type of activity feeds that should be published for directory items / pages. By default, the photo and name of Page Admin is shown in activity feeds of directory items / pages. Using this setting, you can instead choose to show the Page's Photo and Title.", 'multiOptions' => array ('0' => 'Page Admin\'s Photo and Name', '1' => 'Page\'s Photo and Title' ), 'onclick' => 'showEditingOptions("sitepagefeed_type_dummy-wrapper",this.value)', 'value' => Engine_Api::_ ()->getApi ( 'settings', 'core' )->getSetting ( 'sitepage.feed.type', 0 ) ) );
		
		if ((! ( bool ) Engine_Api::_ ()->getApi ( 'settings', 'core' )->getSetting ( 'sitepage.layoutcreate', 0 ) && ! Engine_Api::_ ()->getApi ( 'subCore', 'sitepage' )->isCoreActivtyFeedWidget ( 'sitepage_index_view', 'socialengineaddon.feed' )) || (( bool ) Engine_Api::_ ()->getApi ( 'settings', 'core' )->getSetting ( 'sitepage.layoutcreate', 0 ) && ! Engine_Api::_ ()->getApi ( 'subCore', 'sitepage' )->isPageCoreActivtyFeedWidget ( 'socialengineaddon.feed' ))) {
			
			$this->addElement ( 'Dummy', 'sitepagefeed_type_dummy', array ('decorators' => array (array ('ViewScript', array ('viewScript' => 'admin-settings/activity-feed/_feedType.tpl', 'class' => 'form element' ) ) ) ) );
		}
		$this->addElement ( 'Radio', 'sitepage_feed_likepage', array ('label' => 'Activity Feeds of Pages Liked', 'description' => "Do you want users to receive the activity feeds of Pages that they have liked on their homepage?", 'multiOptions' => array ('1' => 'Yes', '0' => 'No' ), 'onclick' => 'showEditingOptions("sitepagefeed_likepage_dummy-wrapper",this.value)', 'value' => Engine_Api::_ ()->getApi ( 'settings', 'core' )->getSetting ( 'sitepage.feed.likepage', 0 ) ) );
		if (! Engine_Api::_ ()->getApi ( 'subCore', 'sitepage' )->isCoreActivtyFeedWidget ( 'user_index_home', 'socialengineaddon.feed' )) {
			$this->addElement ( 'Dummy', 'sitepagefeed_likepage_dummy', array ('decorators' => array (array ('ViewScript', array ('viewScript' => 'admin-settings/activity-feed/_feedLikepage.tpl', 'class' => 'form element' ) ) ) ) );
		}
		
		if (Engine_Api::_ ()->getApi ( 'settings', 'core' )->getSetting ( 'activity.content', 'everyone' ) != 'everyone') {
			$this->addElement ( 'Radio', 'sitepage_feed_everyone', array ('label' => 'Feed Content on Page Profile', 'description' => 'You have selected "My Friends & Networks" or "My Friends" option for the "Feed Content" field in Activity Feed Settings ("Settings" > "Activity Feed Settings"). Do you want the Feed Content on Page Profiles to be unaffected by that setting, such that all activity feeds be shown on Page Profiles irrespective of the setting there?', 'multiOptions' => array ('1' => 'Yes', '0' => 'No' ), 'onclick' => 'showEditingOptions("sitepagefeed_everyone_dummy-wrapper",this.value)', 'value' => Engine_Api::_ ()->getApi ( 'settings', 'core' )->getSetting ( 'sitepage.feed.everyone', 0 ) ) );
			
			if ((! ( bool ) Engine_Api::_ ()->getApi ( 'settings', 'core' )->getSetting ( 'sitepage.layoutcreate', 0 ) && ! Engine_Api::_ ()->getApi ( 'subCore', 'sitepage' )->isCoreActivtyFeedWidget ( 'sitepage_index_view', 'socialengineaddon.feed' )) || (( bool ) Engine_Api::_ ()->getApi ( 'settings', 'core' )->getSetting ( 'sitepage.layoutcreate', 0 ) && ! Engine_Api::_ ()->getApi ( 'subCore', 'sitepage' )->isPageCoreActivtyFeedWidget ( 'socialengineaddon.feed' ))) {
				
				$this->addElement ( 'Dummy', 'sitepagefeed_everyone_dummy', array ('decorators' => array (array ('ViewScript', array ('viewScript' => 'admin-settings/activity-feed/_feedEveryone.tpl', 'class' => 'form element' ) ) ) ) );
			}
		}
		
		$this->addElement ( 'Button', 'submit', array ('label' => 'Save Changes', 'type' => 'submit', 'ignore' => true ) );
	}

}
?>